Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Programmer's Overview / Part 1 - Getting Started With QuickDraw GX
Chapter 3 - Using QuickDraw GX Objects


Printing Objects

In the same way that the shape object is the main object type for graphics, the job object is the main object type used for printing. A job object represents all
the printing-related information for a single document.

Figure 3-34 shows a job object and its properties.

Figure 3-34 A job object and its properties

Altogether, there are eight types of printing-related objects, and they are
as follows:

Figure 3-35 shows the relationships between all of the printing-related objects.

Figure 3-35 The printing-related objects

Note
Before you can use any QuickDraw GX printing features, your application must call the GXInitPrinting function. You should call this function when initializing your application, immediately after creating a graphics client heap. Once you've called this function, you cannot call any Macintosh Printing Manager functions until you exit from QuickDraw GX printing using the GXExitPrinting function, which you typically do only when closing your application.
You create a job object using the GXNewJob function whenever the user of your application creates a new document. When the user saves the document, you can flatten the information in the job object using either the GXFlattenJob function or the GXFlattenJobToHdl function and then save the printing information along with the document, in either its data or resource fork.

When the user closes the document, you can dispose of the job object using the GXDisposeJob function. If the user reopens the document, you can use the GXUnflattenJob function or the GXUnflattenJobFromHdl function to restore the job object from the flattened information you saved with the document.

When the user chooses the Page Setup menu command from the File menu, your application can use the GXJobDefaultFormatDialog function to display the Page Setup dialog box, as shown in Figure 3-36.

Figure 3-36 The Page Setup dialog box

Similarly, when the user chooses the Print menu command from the File menu, your application can use the GXJobPrintDialog function to display the Print dialog box, shown in Figure 3-37.

Figure 3-37 The Print dialog box

To process update events while these dialog boxes are active, your application must call the GXInstallApplicationOverride function. This function allows you to install a message-handling function that QuickDraw GX calls in response to events that occur while the user is making selections from the dialog boxes. You can find more information about messages in Inside Macintosh: QuickDraw GX Environment and Utilities as well as Inside Macintosh: QuickDraw GX Printing.

When the user requests to print the document, you use

For some examples of printing with QuickDraw GX, see Chapter 8, "Printing," in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help